<?php
/**
 * Created by PhpStorm.
 * User: dong
 * Date: 2018/7/10
 * Time: 0:03
 */
namespace App\Services\ThirdPayments\BankTraits;

use App\Lib\BankMap;

trait CYS8BankMap
{
    private $bankMap = [
        BankMap::GONGSHANG  => 'ICBC',
        BankMap::NONGYE     => 'ABC',
        BankMap::CHINABANK  => 'BOC',
        BankMap::JIANSHE    => 'CCB',
        BankMap::ZHAOSHANG  => 'CMBCHINA',
        BankMap::PUFA       => 'SPDB',
        BankMap::GUANGFA    => 'CGB',
        BankMap::JIAOTONG   => 'BOCO',
        BankMap::YOUZHEN    => 'POST',
        BankMap::ZHONGXIN   => 'CNCB',
        BankMap::MINSHENG   => 'CMBC',
        BankMap::GUANGDA    => 'CEB',
        BankMap::HUAXIA     => 'HXB',
        BankMap::XINGYE     => 'CIB',
        BankMap::PINGAN     => 'PAB',
    ];

    public function getBank($bankCode)
    {
        if (array_key_exists($bankCode, $this->bankMap)) {
            return $this->bankMap[$bankCode];
        } else {
            return 'ICBC';
        }
    }
}